<template>
  <div class="login">
    <div class="warp">
      <!--      <div class="loginLogo">-->
      <!--        <img src="../../assets/images/logo-login.png" alt="" />-->
      <!--      </div>-->
      <!-- 登录 -->
      <div v-if="getPassword" class="loginBox">
        <div class="topText">
          平台登录
        </div>
        <el-card class="box-card">
          <el-tabs v-model="tabs.activeName">
            <el-tab-pane label="账户密码登录" name="account">
              <AccountLogin
                  class="login-form"
                  @forgetPassword="getPassword = false"
              />
            </el-tab-pane>
            <el-tab-pane label="手机号码登录" name="phone">
              <PhoneLogin class="login-form" />
            </el-tab-pane>
          </el-tabs>
        </el-card>
      </div>

      <!-- 找回密码 -->
      <RebackPassword
          v-else
          @backToLogin="() => getPassword = true"
      />
    </div>

    <!--  底部  -->
    <div class="login-footer">© 2019 zkmall</div>
  </div>
</template>

<script setup>
import { defineComponent, reactive, ref } from 'vue';
import AccountLogin from './account.vue';
import PhoneLogin from './phone.vue';
import RebackPassword from './rebackPassword.vue';

defineComponent({
  name: 'LoginIndex'
})

const getPassword = ref(true);

let tabs = reactive({
  activeName: 'account'
})
</script>

<style lang="scss" scoped>
.topText {
  font-weight: 700;
  font-size: 42px;
  color: #231815;
  line-height: 59px;
  text-align: center;
  margin-bottom: 19px;
}
.login {
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url('../../assets/images/background.png') no-repeat center / cover;
  .warp{
    width: 1280px;
    max-width: 96%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    .box-card{
      background: #FFFFFF;
      border-radius: 10px;
      padding: 40px 30px 67px;
    }
  }
}
.loginBox {
  width: 602px;
  .el-tabs{
    :deep(.el-tabs__nav-wrap::after) {
      background-color: transparent;
    }
    :deep(.el-tabs__nav-scroll){
      display: flex;
      justify-content: center;
      .el-tabs__item{
        height: 50px;
        line-height: 50px;
        &.is-active,&:hover{
          color: #FF5000;
        }
      }
      .el-tabs__active-bar{
        background-color: #FF5000;
      }
    }
  }
}

.login-form {
  border-radius: 6px;
  background: #ffffff;
  padding-top: 25px;
  .input-icon {
    height: 39px;
    width: 14px;
    margin-left: 2px;
  }
  .iptHeight {
    height: 60px;
    input {
      height: 60px;
    }
    span {
      display: flex;
      align-items: center;
    }
    .input-icon {
      width: 20px;
      height: 20px;
    }
  }
}

.login-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
}
</style>